function Vector_Field = State2VectorField(S,u)
x = S(1,end);
y = S(2,end);
z = S(3,end);
vx = S(4,end);
vy = S(5,end);
vz = S(6,end);

r1 = ((x+u)^2+y^2+z^2)^(1/2);
r2 = ((x+u-1)^2+y^2+z^2)^(1/2);

Vector_Field = zeros(6,1);

Vector_Field(1:3) = [vx;vy;vz];

Vector_Field(4) = x  -  (1-u)*(x+u)/r1^3  -  u*(x+u-1)/r2^3 + 2*vy;
Vector_Field(5) = y  -  (1-u)*y/r1^3 - u*y/r2^3 - 2*vx;
Vector_Field(6) = -(1-u)*z/r1^3-u*z/r2^3;
end